<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">

<html>

<head>

<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">

<title>svn-buildpackage - maintaining Debian packages with Subversion - Common tasks</title>

</head>

<body>

<p><a name="ch-tasks"></a></p>
<hr>

<p>
[ <a href="ch-import.html">previous</a> ]
[ <a href="index.html#contents">Contents</a> ]
[ <a href="ch-intro.html">1</a> ]
[ <a href="ch-start.html">2</a> ]
[ <a href="ch-import.html">3</a> ]
[ 4 ]
[ <a href="ch-reference.html">5</a> ]
[ <a href="ch-misc.html">6</a> ]
[ <a href="ch-reference.html">next</a> ]
</p>

<hr>

<h1>
svn-buildpackage - maintaining Debian packages with Subversion
<br>Chapter 4 - Common tasks
</h1>

<hr>

<hr>

<h2><a name="s-checkout"></a>4.1 Checkout</h2>

<p>
svn-inject will do the initial checkout for you.  If you need another working
copy, run
</p>

<pre>
     svn co protocol://repository-base-url/yourpackage
</pre>

<hr>

<h2><a name="s-build"></a>4.2 Building the package</h2>

<p>
Change to your trunk directory and run:
</p>

<pre>
     svn-buildpackage -us -uc -rfakeroot
</pre>

<p>
You may recognice the options above -- they are passed directly to the build
command (<samp>dpkg-buildpackage</samp> by default).  Normaly, the build is
done in another directory (exporting the source with cp-la-like method).  If
you wish the resulting packages to be placed in the directory above, use the
<samp>--svn-move</samp> option.  To run Lintian after the build, use
<samp>--svn-lintian</samp> option.  More options are described in the manpage
(<a href="ch-reference.html#s-sbman">svn-buildpackage, Section 5.2</a>).
</p>

<hr>

<h2><a name="s-handlesoure"></a>4.3 Working with source</h2>

<p>
Every time when you add or modify something, <samp>svn-buildpackage</samp>
won't let you proceed unless suspicious files are in the clean state (unless
you use the <samp>--svn-ignore</samp> switch).  You use the commands described
in <a href="ch-start.html#s-basics">Basic svn usage, Section 2.2</a> to
register the new files (or move or delete the old ones) and commit the changes
to the repository.
</p>

<hr>

<h2><a name="s4.4"></a>4.4 Handling new upstream versions</h2>

<p>
Upgrading with new upstream version normaly happens in two steps:
</p>
<ul>
<li>
<p>
the <samp>current</samp> tree in the upstream branch is upgraded with the
source from the new upstream package (the old version is kept in repository in
<samp>branches/upstream/oldVersion</samp>).
</p>
</li>
</ul>
<ul>
<li>
<p>
The version in <samp>trunk/</samp> becomes upgraded by merging the changes
between the upstream versions into the <samp>trunk/</samp> directory.
</p>
</li>
</ul>

<p>
The script <samp>svn-upgrade</samp> (formerly <samp>svn-uupdate</samp>) does
both things for you and also creates a new changelog entry.  The first step is
done internaly by using a third party script (svn_load_dirs, see Subversion
book for documentation), the second step is done with the merge command of svn.
Just run <samp>svn-upgrade</samp> from you local working directory (which
corresponds the <samp>trunk/</samp> checkout product).
</p>

<p>
After running <samp>svn-upgrade</samp> some files may be in conflicting state.
This is naturaly happens if you have modified some files in the upstream
package and now upstream did something similar on the same positions so
<samp>svn merge</samp> was confused.
</p>

<p>
When <samp>svn-upgrade</samp> complains about files in conflicting state, fix
them manualy.  When done, use the <samp>svn resolved</samp> command to mark
them as clean and <samp>svn commit</samp> to update the repository.
</p>

<hr>

<h2><a name="s4.5"></a>4.5 Finalizing the Revision</h2>

<p>
When you are ready to upload a new revision of your package, everything builds
fine, the changelog is cleaned up and the package is tested, you can do the
final build and tag the end version.  To do so, add <samp>--svn-tag</samp>
switch and after the package is built, it will be tagged (by creating a copy of
the <samp>trunk/</samp> directory as said above).
</p>

<hr>

<p>
[ <a href="ch-import.html">previous</a> ]
[ <a href="index.html#contents">Contents</a> ]
[ <a href="ch-intro.html">1</a> ]
[ <a href="ch-start.html">2</a> ]
[ <a href="ch-import.html">3</a> ]
[ 4 ]
[ <a href="ch-reference.html">5</a> ]
[ <a href="ch-misc.html">6</a> ]
[ <a href="ch-reference.html">next</a> ]
</p>

<hr>

<p>
svn-buildpackage - maintaining Debian packages with Subversion
</p>

<address>
$LastChangedDate: 2005-09-23 16:17:33 +0200 (Fr, 23 Sep 2005) $<br>
<br>
Eduard Bloch<br>
<br>
</address>
<hr>

</body>

</html>

